package com.spa.infrastructure.mapper;

import com.spa.domain.entity.Trade;
import com.spa.infrastructure.repository.po.TradePO;
import com.spa.infrastructure.service.wx.result.PaySuccessResult;
import org.mapstruct.Mapper;
import org.mapstruct.MapperConfig;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
@MapperConfig(unmappedTargetPolicy = ReportingPolicy.WARN)
public interface TradeMapperStruct {

    TradeMapperStruct INSTANCE = Mappers.getMapper(TradeMapperStruct.class);

    TradePO command2Po(PaySuccessResult result);

    Trade po2Entity(TradePO po);

    List<Trade> po2EntityList(List<TradePO> po);

    List<TradePO> entity2PoList(List<Trade> entityList);
}
